package com.fjec.market.controller;

import com.fjec.common.protocol.JsonResult;
import com.fjec.market.entity.InfoFarmer;
import com.fjec.market.service.IInfoFarmerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 004.果农表 前端控制器
 * </p>
 *
 * @author admin
 * @since 2020-09-07
 */
@RestController
@RequestMapping("/")
public class InfoFarmerController {

    @Autowired
    private IInfoFarmerService infoFarmerService;

    @GetMapping("/y/farmer/getByUserId")
    public JsonResult getFarmerByUserId(Long userId) {
        return infoFarmerService.getFarmerByUserId(userId);
    }

    @PostMapping("/y/farmer/save")
    public JsonResult saveFarmer(InfoFarmer farmer, String markCode, Long headPicId, String verifyCode) {
       return infoFarmerService.saveFarmer(farmer, markCode, headPicId, verifyCode);
    }
}
